import NameMark from './nameMark'
import Level from './level'

export default {
  // 浮动范围
  floatRange:2,
  // 加成比例
  expSpeedRatio:100,

  // 生成道侣
  generateMate(levelKey){
    let rand = Math.floor(Math.random()*(this.floatRange*2+1));
    let key = levelKey+rand-this.floatRange;
    if(key<0){
        key = 0;
    }
    if(key >= (Level.template.length-1)){
      key = Level.template.length-1;
    }

    return {
      level:key,
      levelName:Level.template[key].name,
      expSpeed:Math.ceil(Level.template[key].expSpeed*this.expSpeedRatio/100),
      state:0,
      name:NameMark.generateWomanName(),
    }
  }

}
